﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using System.Text;

/// <summary>
/// Summary description for UiUtil
/// </summary>
public class UiUtil
{
	public UiUtil()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static String BuildSimpleYUIPanels(Hashtable h, Control c, String ext)
    {
        StringBuilder sb = new StringBuilder();
        for (IDictionaryEnumerator _enum = h.GetEnumerator(); _enum.MoveNext(); )
        {
            String key = c.ID+ext+DataUtil.ObjetToString(_enum.Key);
            sb.Append("YAHOO.example.container.panel" + key + " = new YAHOO.widget.Panel(\"panel" + key + "\", { width:\"320px\", draggable:false,  visible:false, constraintoviewport:true } );");
            sb.Append("YAHOO.example.container.panel"+key+".render();");
            sb.Append("YAHOO.util.Event.addListener(\"show" + key + "\", \"click\", YAHOO.example.container.panel" + key + ".show, YAHOO.example.container.panel" + key + ", true);");
        }
        return sb.ToString();
    }
}
